#pragma once

#include "model_action_container.h"

#include <QAction>

namespace models {

ActionContainer::ActionContainer(QObject * Parent_)
: QObject(Parent_)
{
}

QObject * ActionContainer::Add(const QString & ID_, const QString & Text_, const QString & Icon_)
{
  QAction * pAction = new QAction(this);

  pAction->setObjectName(ID_);
  pAction->setText(Text_);

  if (!Icon_.isEmpty())
  {
    QIcon icon;
    icon.addFile(Icon_, QSize(), QIcon::Normal, QIcon::Off);
    pAction->setIcon(icon);
  }

  return pAction;
}

} // namespace models